package inits

import (
	"log"
	"takeout-grpc/basic/config"

	"github.com/elastic/go-elasticsearch/v7"
)

func InitEs() {
	var err error
	cfg := elasticsearch.Config{
		Addresses: []string{
			"http://localhost:9200",
		},
	}
	config.Elas, err = elasticsearch.NewClient(cfg)
	if err != nil {
		log.Println("es 启动失败")
	}
	log.Println("es 启动成功")
}
